home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_chaselower.cog < prev    next >
Text File  |  1999-11-15  |  12KB  |  387 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SOL_ChaseLower.cog
  4. #
  5. # Triggered by entering lower oil shed room.
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     message     user0
  16.     message     user1
  17.     message     user2
  18.     message     user3
  19.     message     entered
  20.     
  21.     # ** Local Things **
  22.     thing       player          local
  23.     thing       comCar
  24.     thing       car             local
  25.     
  26.     # ** Ghost Objects **
  27.     thing       ghost_Com1
  28.     thing       ghost_Com2
  29.     
  30.     # ** Oil Shed Commies **
  31.     thing       os_Com1         local
  32.     thing       os_Com2         local
  33.     
  34.     # ** Cameras **
  35.     thing       ee_Cam1
  36.     thing       os_cam1
  37.     thing       os_cam2
  38.     thing       os_cam3
  39.     
  40.     thing       ec_cam1
  41.     
  42.     # ** Camera Targets **
  43.     thing       os_CamTarg1
  44.     thing       os_CamTarg2
  45.     thing       os_CamTarg3
  46.     thing       ec_CamTarg1
  47.     
  48.     # ** AI Targets **
  49.     thing       os_Com1Targ
  50.     thing       os_Com2Targ
  51.     thing       os_comTempTarg
  52.     
  53.     # ** explosions **
  54.     thing       chase_Exp1
  55.     thing       chase_Exp2
  56.     
  57.     # ** Player Trigger Surfaces **
  58.     surface     trig_Lower          # start cutscene
  59.     surface     trig_CamCut1
  60.     surface     trig_CamCut2
  61.     surface     trig_CamCut3
  62.     surface     trig_EastEnd1
  63.     surface     trig_EastEnd2
  64.     surface     trig_EastEnd3
  65.     surface     trig_Ready1
  66.     surface     trig_Ready2
  67.     surface     trig_Ready3
  68.     
  69.     # ** Templates **
  70.     template    tpl_Com1=khaki_mauser           local
  71.     template    tpl_Com2=khaki_mauser           local
  72.     template    tpl_Explode=+dummy_bazooka      local
  73.     
  74.     # ** music **
  75.     sound       mus_ComEnt=mus_sol_minechase.wav        local
  76.     
  77.     # ** COGs **
  78.     cog     chaseBlowIt
  79.     cog     chase1doors
  80.     cog     chaseUpper
  81.     cog     hintCog
  82.     cog     comControl
  83.     
  84.     # ** Ints **
  85.     int     curCam          local
  86.     int     ready=0         local
  87.     int     done=0          local
  88.     int     secondLap=0     local
  89.     int     ready=0         local
  90.     int     nextTime=0      local
  91.     int     blownUp=0       local
  92.     
  93. end
  94.  
  95. # ========================================================================================
  96.  
  97. code
  98.  
  99. startup:
  100.  
  101.     # hide comCar
  102.     SetThingFlags(comCar, 0x80000);
  103.     
  104.     return;
  105.     
  106. # ========================================================================================
  107.  
  108. user0:
  109.  
  110.     blownUp = 1;
  111.     return;
  112.     
  113. # ========================================================================================
  114.  
  115. user1:
  116.  
  117.     done = 0;
  118.     return;
  119.     
  120. # ========================================================================================
  121.  
  122. user2:
  123.     
  124.     secondLap = 1;
  125.     return;
  126.     
  127. # ========================================================================================
  128.  
  129. user3:
  130.  
  131.     # message received from sol_ambush.cog
  132.     # we just played the ambush scene, so let's go
  133.     # around one more time.
  134.     Print("chaseLower: nextTime = 1");
  135.     nextTime = 1;
  136.     return;
  137.  
  138. # ========================================================================================
  139.  
  140. entered:
  141.         
  142.     player = GetLocalPlayerThing();
  143.     curCam = GetCurrentCamera();
  144.     car = GetSourceRef();
  145.     
  146.     if((BitTest(GetPhysicsFlags(car), 0x01000000)) && (blownUp == 0))
  147.     {
  148.         # need to take one more lap
  149.         if((done == 0) && (secondLap == 0) && (ready == 0))
  150.         {
  151.             if(GetSenderRef() == trig_Lower)
  152.             {
  153.                 Print("chaseLower: secondLap = 1");
  154.                 secondLap = 1;
  155.                 
  156.                 # tell chaseUpper that secondLap = 1
  157.                 SendMessage(chaseUpper, user2);
  158.                 
  159.                 # turn on switch4 and switch5 commies
  160.                 SendMessage(comControl, user0);
  161.             }
  162.         }
  163.         
  164.         else if((done == 0) && (secondLap == 1) && (ready == 0))
  165.         {
  166.             # approaching from switch3
  167.             if((GetSenderRef() == trig_Ready1) && (nextTime == 0))
  168.             {
  169.                 ready = 1;
  170.             }
  171.             
  172.             # approaching from switch2
  173.             else if(GetSenderRef() == trig_Ready2)
  174.             {
  175.                 ready = 1;
  176.             }
  177.             
  178.             # approaching from horus room
  179.             else if(GetSenderRef() == trig_Ready3)
  180.             {
  181.                 ready = 1;
  182.                 nextTime = 0;
  183.                 
  184.                 # turn on switch4 and switch5 commies
  185.                 SendMessage(comControl, user0);
  186.             }
  187.             
  188.             else if((GetSenderRef() == trig_Lower) && (nextTime == 1))
  189.             {
  190.                 nextTime = 0;
  191.             }
  192.         }
  193.         
  194.         else if((done == 0) && (secondLap == 1) && (ready == 1) && (nextTime == 0))
  195.         {
  196.             # cutscene starts from switch3
  197.             if(GetSenderRef() == trig_EastEnd1)
  198.             {
  199.                 #Print("chaseLower: trig_EastEnd1");
  200.                 # disable player
  201.                 StartCutscene(0);
  202.                 SetActorFlags(player, 0x200000);
  203.                 
  204.                 # Cut to ee_Cam1
  205.                 SetCameraFocus(2, ee_Cam1);
  206.                 SetCameraSecondaryFocus(2, player);
  207.                 SetCurrentCamera(2);
  208.                 
  209.                 # slow down player
  210.                 SetThingThrust(player, '0.0 2.5 0.0');
  211.             }
  212.             
  213.             # cutscene starts from switch2
  214.             else if(GetSenderRef() == trig_EastEnd2)
  215.             {
  216.                 #Print("chaseLower: trig_EastEnd2");
  217.                 # disable player
  218.                 StartCutscene(1);
  219.                 SetActorFlags(player, 0x200000);
  220.                 
  221.                 # Cut to ee_Cam1
  222.                 SetCameraFocus(2, ee_Cam1);
  223.                 SetCameraSecondaryFocus(2, player);
  224.                 SetCurrentCamera(2);
  225.                 
  226.                 # slow down player
  227.                 SetThingThrust(player, '0.0 2.5 0.0');
  228.             }
  229.             
  230.             # cutscene starts from horus room
  231.             else if(GetSenderRef() == trig_EastEnd3)
  232.             {
  233.                 Print("chaseLower: trig_EastEnd3");
  234.                 # disable player
  235.                 StartCutscene(1);
  236.                 SetActorFlags(player, 0x200000);
  237.                 
  238.                 # Cut to ee_Cam1
  239.                 SetCameraFocus(2, ee_Cam1);
  240.                 SetCameraSecondaryFocus(2, player);
  241.                 SetCurrentCamera(2);
  242.                 
  243.                 # slow down player
  244.                 SetThingThrust(player, '0.0 2.5 0.0');
  245.             }
  246.                 
  247.             # fire up the main cutscene
  248.             else if(GetSenderRef() == trig_Lower)
  249.             {
  250.                 #Print("chaseUpper: trig_Upper");
  251.                 # temporary spot for holding mine doors open
  252.                 SendMessage(chase1doors, user2);
  253.                 
  254.                 # enable chaseBlowIt
  255.                 SendMessage(chaseBlowIt, user1);
  256.                 
  257.                 # stop player
  258.                 StopThing(player);
  259.                 
  260.                 # cut to comcar entering thru Reflec Level 2
  261.                 SetCameraFocus(2, os_cam1);
  262.                 SetCameraSecondaryFocus(2, os_CamTarg1);
  263.                 SetCurrentCamera(2);
  264.                 
  265.                 # show comCar
  266.                 ClearThingFlags(comCar, 0x80000);
  267.                 
  268.                 # create first two oil shed commies
  269.                 os_Com1 = CreateThing(tpl_Com1, ghost_Com1);
  270.                 CaptureThing(os_Com1);
  271.                 os_Com2 = CreateThing(tpl_Com2, ghost_Com2);
  272.                 CaptureThing(os_Com2);
  273.                 
  274.                 # prepare oil shed commies for cutscene
  275.                 AISetCutsceneMode(os_Com1);    
  276.                 AISetCutsceneMode(os_Com2);
  277.                 
  278.                 # rest for a bit if necessary and then set thrust
  279.                 Sleep(0.1);
  280.                 SetThingThrust(comCar, '0.0 2.5 0.0');
  281.                     
  282.                 # play com entrance music
  283.                 PlaySoundLocal(mus_ComEnt, 1.0, 0.0, 0x0, 0);
  284.                 
  285.                 Sleep(1.0);
  286.                 
  287.                 # send os_com1 running in after comCar
  288.                 AISetMoveSpeed(os_com1, 4.0);
  289.                 AISetLookThing(os_com1, os_comTempTarg);
  290.                 AISetMoveThing(os_com1, os_comTempTarg, 0);
  291.                 
  292.                 # give player some thurst
  293.                 SetThingThrust(player, '0.0 2.25 0.0');  # 3
  294.                 
  295.                 # slow down comCar
  296.                 SetThingThrust(comCar, '0.0 1.75 0.0');  # 2
  297.                 
  298.                 # rest for a bit if necessary
  299.                 Sleep(0.5);
  300.                 
  301.                 # cut to shot of player on upper 
  302.                 # track and comCar on lower track
  303.                 SetCameraFocus(2, os_cam2);
  304.                 SetCameraSecondaryFocus(2, os_CamTarg2);
  305.                 SetCurrentCamera(2);
  306.                 
  307.                 # send os_com2 running in after comCar.
  308.                 AISetMoveSpeed(os_com2, 3.0);
  309.                 AISetLookThing(os_com2, os_com2Targ);
  310.                 
  311.                 AISetLookThing(os_com1, os_com1Targ);
  312.                 AISetMoveThing(os_com1, os_com1Targ, 0);
  313.                 
  314.                 AISetMoveThing(os_com2, os_comTempTarg, 1);
  315.                 AISetMoveThing(os_com2, os_com2Targ, 0);
  316.                 
  317.                 # give player some thurst
  318.                 SetThingThrust(player, '0.0 3.0 0.0');
  319.             }
  320.             
  321.             else if(GetSenderRef() == trig_CamCut1)
  322.             {
  323.                 #Print("ChaseUpper: camCut1");
  324.                 # cut to camera at base of upper tracks to show
  325.                 # player and comCar racing towards exit.
  326.                 SetCameraFocus(2, os_Cam3);
  327.                 SetCameraSecondaryFocus(2, os_CamTarg3);
  328.                 SetCurrentCamera(2);
  329.                 
  330.                 # speed up comCar
  331.                 SetThingThrust(comCar, '0.0 3.0 0.0');
  332.             }
  333.             
  334.             else if(GetSenderRef() == trig_CamCut2)
  335.             {
  336.                 #Print("ChaseUpper: camCut2");
  337.                 # cut to exit complex camera to show player and
  338.                 # comCar bursting thru mine doors.
  339.                 SetCameraFocus(2, ec_Cam1);
  340.                 SetCameraSecondaryFocus(2, ec_CamTarg1);
  341.                 SetCurrentCamera(2);
  342.                 
  343.                 # speed up comCar
  344.                 SetThingThrust(comCar, '0.0 4.5 0.0');  # 5
  345.             }
  346.             
  347.             else if(GetSenderRef() == trig_CamCut3)
  348.             {
  349.                 #Print("ChaseUpper: camCut3");
  350.                 # cut to merge cam to show comCar zipping in
  351.                 # front of player.
  352.                 
  353.                 # slow down comCar
  354.                 SetThingThrust(comCar, '0.0 3.5 0.0');
  355.                 
  356.                 # match player speed with comCar
  357.                 SetThingThrust(player, '0.0 3.5 0.0');
  358.                 
  359.                 # restore player control
  360.                 SetCurrentCamera(1);
  361.                 ClearActorFlags(player, 0x200000);
  362.                 EndCutscene();
  363.                 
  364.                 # destroy commies
  365.                 DestroyThing(os_Com1);
  366.                 DestroyThing(os_Com2);
  367.                 
  368.                 # tell hintCog to solve hint10
  369.                 SendMessage(hintCog, user0);
  370.                 
  371.                 done = 1;
  372.                 
  373.                 Sleep(2.0);
  374.                 CreateThing(tpl_Explode, chase_Exp1);
  375.                 Sleep(2.0);
  376.                 CreateThing(tpl_Explode, chase_Exp2);
  377.             }
  378.         }
  379.     }
  380.     
  381.     return;
  382.         
  383. # ========================================================================================
  384.  
  385. end
  386.  
  387.